package com.lujieni.seatastore.controller;


import com.lujieni.seataproxy.dto.StoreDTO;
import com.lujieni.seatastore.dao.StorePOMapper;
import com.lujieni.seatastore.po.StorePO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class StoreController {

    @Autowired
    private StorePOMapper storePOMapper;

    @PostMapping(value = "/addStore")
    public void addPay(@RequestBody StoreDTO storeDTO) {
        StorePO storePO = new StorePO();
        BeanUtils.copyProperties(storeDTO, storePO);
        storePOMapper.insert(storePO);

        storePO.setId(2L);
        storePOMapper.insert(storePO);
        int n = 5 / 0;

    }

}
